# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         hmwk02
# Description:
# Author:       ASUS
# Date:         2019/3/16
#-------------------------------------------------------------------------------


"""
三个类，一个是人基类，老师、学生继承人，老师去教工食堂吃饭，住在家里或教工宿舍，学生去普通食堂吃饭，住学生宿舍
老师讲课，学生上课，共有属性姓名，年龄，性别，身高，体重，定义共有方法和特有方法各三个
特有属性一个以上（老师：工资 学生：学费）
"""

class Person:
    def __init__(self,name,age,sex,height,weight):
        "初始化信息"
        self.name = name
        self.age = age
        self.sex = sex
        self.height= height
        self.weight = weight

    def getname(self):
        "获取姓名"
        return self.name

    def getsex(self):
        "获取性别"
        return self.sex

    def greet(self):
        "自我介绍"
        return "大家好，我叫{}".format(self.name)


class Teacher(Person):
    def __init__(self,name,age,sex,height,weight,salary):
        "初始化信息"
        super().__init__(name,age,sex,height,weight)
        self.salary = salary

    def getaddress(self):
        "获得住址"
        return "老师住家里或教工宿舍"

    def geteat(self):
        "获取老师吃饭的地点"
        return "老师去教工食堂吃饭"

    def getskill(self):
        "获取老师的技能"
        return "老师会讲课"


class Student(Person):
    def __init__(self,name,age,sex,height,weight,tuition):
        "初始化信息"
        super().__init__(name,age,sex,height,weight)
        self.tuition = tuition

    def getaddress1(self):
        "获得住址"
        return "学生住学生宿舍"

    def geteat1(self):
        "获取学生吃饭的地点"
        return "学生去普通食堂吃饭"

    def getskill1(self):
        "获取学生的技能"
        return "学生去上课"


if __name__ =="__main__":
    teacher1 = Teacher("张三",35,"男","170cm",160,5000)
    print(teacher1.getname())
    print(teacher1.getaddress())
    print("-------------------------")
    student1 = Student("李梅",18,"女","160cm",100,7000)
    print(student1.name)
    print(student1.tuition)




